<?php
class Cl_PostReport extends WdkClass 
{
	protected
		/******************************************************/
		//	원본 테이블 정보
		/******************************************************/
		$post_report_seq			= 0		,	//
		$fk_post_seq				= 0		,	//	
		$fk_user_seq				= 0		,	//	
		$post_report_memo			= ''	,	//	
		$post_report_insert_time	= 0		;	//	
		/******************************************************/
		//	추가 정보
		/******************************************************/
	
	/**
	 * 	
	 */
	function __construct()
	{
		parent::__construct();
		self::getDbo();
	}
	
	/**
	 *	
	 */
	public function __init($data)
	{
		parent::__init($data);
		self::dformat();
	}
	
	/**
	 *	
	 */
	public function load($post_report_seq)
	{
		/*------------------------------------------------------------*/
		$dbo = self::getDbo();
		/*------------------------------------------------------------*/
		self::__init($dbo->cLoad($post_report_seq));
	}
	
	/**
	 *	
	 */
	public function loadByPost($post_seq=0, $user_seq=0)
	{
		/*------------------------------------------------------------*/
		$dbo = self::getDbo();
		/*------------------------------------------------------------*/
		self::__init($dbo->cLoadByPost($post_seq, $user_seq));
	}
	
	/**
	 *	
	 */
	public function dformat()
	{
	}
	
	/**
	 *	
	 */
	public function insert()
	{
		/*------------------------------------------------------------*/
		$dbo = self::getDbo();
		/*------------------------------------------------------------*/

		$this->post_report_insert_time	= time();
		
		$data = array(	'fk_post_seq'				=>	$this->fk_post_seq,
						'fk_user_seq'				=>	$this->fk_user_seq,
						'post_report_memo'			=>	$this->post_report_memo,
						'post_report_insert_time'	=>	$this->post_report_insert_time
					);
		$this->post_report_seq = $dbo->insert($data);
	}
	
	/**
	 *	
	 */
	public function report($post_seq=0, $user_seq=0)
	{
		$this->fk_post_seq = $post_seq;
		$this->fk_user_seq = $user_seq;
		$this->insert();
	}
	
	/**
	 * 
	 */
	public function update()
	{
		throw new DatabaseDisableException("");		
	}
	
	/**
	 * 
	 */
	public function delete()
	{
		throw new DatabaseDisableException("");
	}
	
	/**
	 *	
	 */
	private function backup($log='')
	{
		throw new DatabaseDisableException("");
	}
	
	/**
	 * 
	 */
	public function getDbo()
	{
		return Wdk::model(substr(__CLASS__, 3));
	}
}